home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_200
/
250_01
/
floor.s
< prev
next >
Wrap
Text File
|
1987-10-27
|
640b
|
35 lines
.ttl "floor.s"
* MC68020/MC68881 IEEE Format Single Precision Routines
*
* Written by: Edmund H. Ramm
*
* _floor entry point for single prec. floor, operand in 4(sp)
*
* sp 4
* ---------------
* | ret | x |
.text
.globl _floor
_floor:
*
* on exit, d0 = floor( 4(sp) )
*
moveq #$20,d1
* fmove.l d1,fpcr * select round to -infinity
dc.w $f201,$9000
* fint.s 4(sp),fp0 * fp0 <-- floor( 4(sp) )
dc.w $f22f,$4401,$0004
* fmove.s fp0,d0 * d0 <-- floor(x)
dc.w $f200,$6400
moveq #0,d1
* fmove.l d1,fpcr * re-select ieee defaults
dc.w $f201,$9000
rts
.end